﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MudEngine
{
	public class Telnet
	{
		public const byte LF = 0x0A;
		public const byte CR = 0x0D;

        public static byte[] CRLF = new byte[] { CR, LF };

		public const byte IAC = 0xFF;
		public const byte CMD_SE = 0xF0; // end OP_SUBSTRACT negotiate
		public const byte CMD_BREAK = 0xF3; 
		public const byte CMD_IP = 0xF4; 
		public const byte CMD_AYT = 0xF6; 
		public const byte CMD_SB = 0xFA; // OP_SUBSTRACT negotiate
		public const byte CMD_WILL = 0xFB;
		public const byte CMD_WONT = 0xFC;
		public const byte CMD_DO = 0xFD;
		public const byte CMD_DONT = 0xFE;

		public const byte OPT_BIN = 0x00;
		public const byte OPT_ECHO = 0x01;
		public const byte OPT_RECONN = 0x02;
		public const byte OPT_SUPGO = 0x03;
		public const byte OPT_MESSNEG = 0x04;
		public const byte OPT_STATUS = 0x05;
		public const byte OPT_TIMEMARK = 0x06;
		public const byte OPT_TRANSECHO = 0x07;
		public const byte OPT_LINEWIDTH = 0x08;
		public const byte OPT_PAGSIZE = 0x09;
		public const byte OPT_CARRET = 0x0A;
		public const byte OPT_HORTABSTOP = 0x0B;
		public const byte OPT_HORTABDIS = 0x0C;
		public const byte OPT_FORMFEEDDIS = 0x0D;
		public const byte OPT_VERTTABSTOP = 0x0E;
		public const byte OPT_VERTTABDIS = 0x0F;
		public const byte OPT_LINEFEEDDIS = 0x10;
		public const byte OPT_EXTASCII = 0x11;
		public const byte OPT_LOGOUT = 0x12;
		public const byte OPT_BYTEMARCO = 0x13;
		public const byte OPT_DATATERM = 0x14;
		public const byte OPT_SUPDUP = 0x15;
		public const byte OPT_SUPDUPOUT = 0x16;
		public const byte OPT_SNDLOC = 0x17;
		public const byte OPT_TTYPE = 0x18;
		public const byte OPT_EOR = 0x19;
		public const byte OPT_USERID = 0x1A;
		public const byte OPT_OUTMARK = 0x1B;
		public const byte OPT_LOCNR = 0x1C;
		public const byte OPT_3270REG = 0x1D;
		public const byte OPT_X3PAD = 0x1E;
		public const byte OPT_NEGWINSIZE = 0x1F;
		public const byte OPT_TERMSPEED = 0x20;
		public const byte OPT_REMFLOW = 0x21;
		public const byte OPT_LINEMODE = 0x22;
		public const byte OPT_XDISPLOC = 0x23;
		public const byte OPT_ENVOPT = 0x24;
		public const byte OPT_AUTHOPT = 0x25;
		public const byte OPT_ENCRYPTOPT = 0x26;
		public const byte OPT_NEWENVOPT = 0x27;
		public const byte OPT_TN3270E = 0x28;
		public const byte OPT_EXTOPTLIST = 0xFF;
	}
}
